﻿@model MvcApplication6.Models.ProductDetailModel
@using MvcApplication6.Models
@using MvcApplication6.common
@{
    var title = @Model.Product.title;
    }

<div class="pr-head"><span>Sản Phẩm: @Model.Product.Name</span></div>
@Html.Hidden("CommentParentID", @Model.Product.title)
<div class="detail_pro">
    <input type="hidden" id="linkImage" value="http://aptechpro.vn/Upload/Images/@Model.Product.Image" />
    <input type="hidden" id="linkName" value="@Model.Product.Name" />
     <div id="fb-root"></div>
    <script>        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        } (document, 'script', 'facebook-jssdk'));</script>
    <div class="channel_header" style="margin-top:20px;">
        <img src="http://aptechpro.vn/Upload/Images/@Model.Product.Image" />
		<p style="font-weight:normal; font-size:18px; line-height:24px;">Mã sản phẩm: <span style="font-weight:bold; font-size:22px; color:#e70005">@Model.Product.Name</span></p>
		<p class="saleDisplay" style="font-weight:normal; font-size:18px; line-height:24px; color:blue">Giảm đến 60%</p>
		<p style="font-weight:normal; font-size:18px; line-height:24px;">Bảo hành: @Model.Product.Warranty</p>
		<p style="font-weight:normal; font-size:18px; line-height:24px;">Xuất xứ: @Model.Product.MakeIn</p>
        @if (@Model.Product.ProsalesFlag == 1 || @Model.Product.Sale > 0)
        {
             <span class="pr-desc" style="text-decoration: line-through;font-weight:bold; font-size:14px;">Giá chính hãng: @FormatStringNumber.FormatString(@Model.Product.Price.ToString()) </span>
            <span class="pr-price">Giảm còn: @FormatStringNumber.FormatString(((@Model.Product.Price * (100 - @Model.Product.Sale)) / 100).ToString()) VNĐ</span>
        }
        else
        { 
            <span class="pr-desc-red">@Model.Product.CallToSale</span>
            <span class="pr-price">Giá: @FormatStringNumber.FormatString(((@Model.Product.Price * (100 - @Model.Product.Sale)) / 100).ToString()) VNĐ</span>
        }
       	

         @if (Session["checkLoginAbcuser"] != null)
         { 
       @* <a  href="Admin/AddProduct?ProductId=@Model.Product.Id">Sửa</a>*@
        
         @Html.ActionLink("|Sửa",
                        "AddProduct",   // <-- ActionMethod
                        "Admin",  // <-- Controller Name.
                        new
                        {
                            ProductId = @Model.Product.Id
                        }, // <-- Route arguments.
                        null
                        )       
             
             
        @Ajax.ActionLink(
            "Xóa",
            "DeleteProduct",
            new
            {
                Id = @Model.Product.Id,
                LevelMenu = 0,
                page = 1,
                IdCe = 0,
                TitleMenu = "1",
                Flag = 2,
                MenuId1 = @Model.MenuId1,
                MenuId2 = @Model.MenuId2,
                MenuId3 = @Model.MenuId3

            },
            new AjaxOptions
            {
                HttpMethod = "GET",
                InsertionMode = InsertionMode.Replace,
                UpdateTargetId = "listProduct",
                OnBegin = "myonbegin",
                OnSuccess = "myonsuccess",
                OnFailure = "myonfailure"
            }
            )

         }
        <div class="share" style="margin-top:15px;">
            <span class='st_facebook_hcount' displayText='Facebook'></span>
            <span class='st_twitter_hcount' displayText='Tweet'></span>
            <span class='st_email_hcount' displayText='Email'></span>
			<span class='st_googleplus_hcount' displayText='Google +'></span>
          @*  <div class="fb-share-button" id="share_faceBook_Demo" data-href=""></div>*@

        </div>
    </div>
	<br>
	<div class="fb-comments" data-href="http://aptechpro.vn/" data-width="450px" data-numposts="5" data-colorscheme="light"></div>
    <div class="clear"></div>
    <br>   
    <div class="content-product" style="margin-top:20px;">
        <ul id="menu" class="menu">
		<li class="active"><a href="#thongsokythuat">Thông số kỹ thuật</a></li>
		<li><a href="#hinhanh">Tổng quan sản phẩm</a></li>
		<li><a href="#sanphamcungloai">Sản phẩm cùng loại</a></li>
        </ul>
        <div id="thongsokythuat" class="content-tab" style="padding:10px 0">
            @Html.Raw(System.Web.HttpUtility.HtmlDecode(Model.Product.InfPro))
        </div>
        <div id="hinhanh" class="content-tab">
            @*<br><img style="max-width: 80%;" src=http://aptechpro.vn/Upload/Images/@Model.Product.Image><br><br>*@
            @if (Model.Product.introduce_pro !=null)
            {    
                @Html.Raw(System.Web.HttpUtility.HtmlDecode(Model.Product.introduce_pro))
            }
            
        </div>
        <div id="sanphamcungloai" class="content-tab" style="display: flex; padding:20px 0 10px">
            <div class="list-view">
                <ul class="pr-list" id="list1">
                    @if (Model.producListtModel.Count > 0)
                    {
                        foreach (var product in Model.producListtModel)
                        { 
                            <li class="pr-item" style="width: 30%;">
                                @*@Ajax.ImageActionLink(
                                 "../../Upload/Images/" + @product.Image,
                                "",
                                 "ProductDetail",
                                new
                                {
                                    LevelMenu = @Model.LevelMenu,
                                    Id = @product.Id,
                                    MenuId1 = @Model.MenuId1,
                                    MenuId2 = @Model.MenuId2,
                                    MenuId3 = @Model.MenuId3
                                },
                                new AjaxOptions
                                {
                                    HttpMethod = "GET",
                                    InsertionMode = InsertionMode.Replace,
                                    UpdateTargetId = "listProduct"
                                },
                                   new { @class = "pr-img" }
                                )*@


                              @*   <a href="@Url.Action("ProductDetail"
                                            , new
                                            {
                                                LevelMenu = @Model.LevelMenu,
                                                Ids = @product.Id,
                                                MenuId1 = @Model.MenuId1,
                                                MenuId2 = @Model.MenuId2,
                                                MenuId3 = @Model.MenuId3
                                            }
                                         )"
                                >
                                    <img class = "pr-img" src="http://aptechpro.vn/Upload/Images/@product.Image"/>
                                </a>*@

                                <a href="/Home/ProductDetail/1/@Model.LevelMenu/@product.Id/@Model.MenuId1/@Model.MenuId2/@Model.MenuId3/@product.Name">
                                    <img class = "pr-img" src="http://aptechpro.vn/Upload/Images/@product.Image"/>
                                </a>




				    @*            <img class="pr-img" src =../../Upload/Images/@product.Image />*@
                                @if (@product.ProsalesFlag == 1 || @product.Sale > 0)
                                {
                                    <div class="buy-tag">- @product.Sale %</div>
                                }
                                
			                <div class="pr-info">

                                @if (Model.LevelMenu == 2)
                                {
                                    <span class="pr-name">@product.Name</span>
                                }
                                
                                @if (Model.LevelMenu == 3)
                                {
                                    <span class="pr-name">@product.Name</span>
                                }
                                else
                                {
                                    <span class="pr-name">@product.Name</span>
                                }
                                
				                
				                <span class="pr-desc">Xuất xứ: @product.MakeIn </span>
                                <span class="pr-desc">Bảo hành: @product.Warranty </span>
								<span class="pr-desc priceSale saleDisplay">Giảm đến 60%</span>
                                   @if (product.ProsalesFlag == 1 || @product.Sale > 0)
                                   {
                                     <span class="pr-desc" style="text-decoration: line-through;">Giá chính hãng @FormatStringNumber.FormatString(@product.Price.ToString()) </span>
                                   }
                                   else
                                   {
                                     <span class="pr-desc-red">@product.CallToSale</span>
                                   }
				                <span class="pr-price">
                                     @*@Ajax.ActionLink(
                                        "Giá:" + @FormatStringNumber.FormatString(((@product.Price * (100 - @product.Sale)) / 100).ToString()) + "VNĐ",
                                        "ProductDetail",
                                        new
                                        {
                                            LevelMenu = @Model.LevelMenu,
                                            Id = @product.Id,
                                            MenuId1 = @Model.MenuId1,
                                            MenuId2 = @Model.MenuId2,
                                            MenuId3 = @Model.MenuId3
                                        },
                                        new AjaxOptions
                                        {
                                            HttpMethod = "GET",
                                            InsertionMode = InsertionMode.Replace,
                                            UpdateTargetId = "listProduct"
                                        }
                                     )*@

                                    @*  @Html.ActionLink("Giá:" + @FormatStringNumber.FormatString(((@product.Price * (100 - @product.Sale)) / 100).ToString()) + "VNĐ"
                                    , "ProductDetail"
                                    , new
                                    {
                                        LevelMenu = @Model.LevelMenu,
                                        Ids = @product.Id,
                                        MenuId1 = @Model.MenuId1,
                                        MenuId2 = @Model.MenuId2,
                                        MenuId3 = @Model.MenuId3
                                    }
                                    , null)*@

                                     @if (product.ProsalesFlag == 1 || @product.Sale > 0)
                                     {
                                        <a href="/Home/ProductDetail/1/@Model.LevelMenu/@product.Id/@Model.MenuId1/@Model.MenuId2/@Model.MenuId3/@product.Name">
                                        Giảm còn: @FormatStringNumber.FormatString(((@product.Price * (100 - @product.Sale)) / 100).ToString()) VNĐ
                                        </a>
                                     }
                                     else
                                     {
                                        <a href="/Home/ProductDetail/1/@Model.LevelMenu/@product.Id/@Model.MenuId1/@Model.MenuId2/@Model.MenuId3/@product.Name">
                                            Giá: @FormatStringNumber.FormatString(((@product.Price * (100 - @product.Sale)) / 100).ToString()) VNĐ
                                        </a>
                                     }
                                </span>
                                 @if (Session["checkLoginAbcuser"] != null)
                                 {
                                   @* <a  href="Admin/AddProduct?ProductId=@Model.Product.Id">Sửa</a>*@
                                       @Html.ActionLink("|Sửa",
                                            "AddProduct",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                ProductId = @Model.Product.Id
                                            }, // <-- Route arguments.
                                            null
                                            )

                                     
                                    @Ajax.ActionLink(
                                        "Xóa",
                                        "DeleteProduct",
                                        new
                                        {
                                            Id = @Model.Product.Id,
                                            LevelMenu = 0,
                                            page = 1,
                                            IdCe = 0,
                                            TitleMenu = "1",
                                            Flag = 2,
                                            MenuId1 = @Model.MenuId1,
                                            MenuId2 = @Model.MenuId2,
                                            MenuId3 = @Model.MenuId3

                                        },
                                        new AjaxOptions
                                        {
                                            HttpMethod = "GET",
                                            InsertionMode = InsertionMode.Replace,
                                            UpdateTargetId = "listProduct",
                                            OnBegin = "myonbegin",
                                            OnSuccess = "myonsuccess",
                                            OnFailure = "myonfailure"
                                        }
                                        )
                                 }
			                </div>
		                </li>
                        
                        }
                    }
                    else
                    { 
                         <div class="pr-head" style="background:none;"><span style="box-shadow:none;">Không có sản phẩm cùng loại</span></div>
                    }
	            </ul>
    
            </div><!--end. listview-->
        </div>
    </div><!--end. content-product-->
       
    </div> 

<script type="text/javascript">
    $(document).ready(function () {
        var asd = $('#CommentParentID').val();
        $('#menu').tabify();
        $('#menu2').tabify();
        $('#titleWeb').empty();
        $('#titleWeb').append(asd);
    });
</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>
<script>
    var options = { "publisher": "8229364d-d482-4975-8520-e649662d9d70", "position": "left", "ad": { "visible": false, "openDelay": 10, "closeDelay": 0 }, "chicklets": { "items": ["googleplus", "facebook", "twitter", "email", "sharethis"]} };
    var st_hover_widget = new sharethis.widgets.hoverbuttons(options);
</script>
